package org.ainlolcat.ainscience2.model.filter.impl;

import org.ainlolcat.ainscience2.controller.loader.LoaderDefinition;
import org.ainlolcat.ainscience2.model.filter.Filter;

/**
 * Created by IntelliJ IDEA.
 * User: ain
 * Date: 17.06.12
 * Time: 2:23
 * To change this template use File | Settings | File Templates.
 */
public class LoaderDefinitionFilter implements Filter {

    String parentName;

    public LoaderDefinitionFilter(String parentName) {
        this.parentName = parentName;
    }

    public boolean isValid(Object column) {
        if (column instanceof LoaderDefinition){
            String fullName = ((LoaderDefinition)column).getNamespace() + "." + ((LoaderDefinition)column).getName();
            return fullName.equals(parentName);
        } else{
            return false;
        }
    }
}